package com.yuanluludev.app.room.book

import androidx.room.TypeConverter
import com.yuanluludev.lib_utils.util.GsonUtils

class BookConverter {

    @TypeConverter
    fun stringToBookList(string: String): List<Book>? {
        return GsonUtils.fromJson(string, GsonUtils.getListType(Book::class.java))
    }

    @TypeConverter
    fun bookListToString(list: List<Book>?): String? {
        return GsonUtils.toJson(list)
    }

}